<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -  
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	public function index()
	{
		$this->load->helper('url');
		echo base_url();exit;
		$this->load->view('welcome_message');
		
	}
	public function code_image()
	{
		$this->load->library('captcha', array('code_type'=>'7'));
		$this->captcha->show();
		return ;
	}
	public function captcha(){
	//echo 'e';exit;
	$this->load->helper('url');
	$this->load->library('session');
		$this->load->helper('captcha');
		$arr = array(
			'img_path'=>'./captcha/',
			'img_url'=>base_url('captcha').'/',
			'img_width'=>'80',
			'img_height'=>'30',
			'expiration' => '20'
		);
		$cap = create_captcha($arr);
		$this->session->set_userdata($cap['word']);
		//var_dump($cap);
		//echo $cap['word'];
		//echo base_url();
		echo $cap['image'];
		//echo 'verify code';
	}
	
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */